package com.ssm.demo.util.global;

/**
 * @description: 全局异常信息枚举
 */
public enum GlobalExceptionEnum {
    //与URL状态码一致
    URL_PATH_401(401, "无请求权限"),
    URL_PATH_403(403, "Forbidden"),
    URL_PATH_404(404, "请求路径不存在"),
    URL_PATH_405(405, "请求方式(GET/POST)不对"),
    URL_PATH_500(500, "服务器错误"),
    //1XXXX 业务级别
    NEED_PARAMS(10001, "缺少请求参数"),
    REQUEST_PARAM_ERROR(10012, "请求参数错误"),
    //2XXXX 系统级别
    SYSTEM_ERROR(20000, "系统异常，请联系管理员"),
    ;
    /**
     * 异常码
     */
    Integer code;
    /**
     * 异常信息
     */
    String msg;

    GlobalExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
